var express = require('express');
var router = express.Router();

const { tenantsName, getTenantsData,checkTenants } = require('../service/tenantsService');

// 增加租客的信息
router.post("/addTenantsData", async function (req, res, next) {
    const data = req.body;
    const result = await tenantsName(data);
    res.send(result);
});

// 获取所有租客的信息
router.post("/getTenants", async function (req, res, next) {
    console.log(req.body);
    const result = await getTenantsData(req.body);
    res.send(result);
});

//审核身份证
router.post('/checkTenants',async function (req,res,next){
    console.log(req.body);
    const result = await checkTenants(req.body)
    res.send(result)
})
module.exports = router;
